cmake_minimum_required(VERSION 3.28)
project(CrossPlatformPlayer)

set(CMAKE_CXX_STANDARD 17)
include_directories(decoder render util util/ImageDef.h)
set(CMAKE_CXX_FLAGS "-Wno-error=deprecated-declarations -Wno-deprecated-declarations ")
add_executable(CrossPlatformPlayer main.cpp
        render/SDLRender.cpp
        decoder/DecoderBase.cpp
        decoder/VideoDecoder.cpp
        util/ImageDef.h
        render/VideoRender.h
        player/FFmplayer.cpp
        player/FFmplayer.h
        util/SLog.h

)
# First, tell CMake to find the packages.
# Conan will install the packages so that CMake can find them:
# Then, link your executable or library with the corresponding package targets:
find_package(SDL2)
find_package(glog)
#
#find_package(SDL2_image)
if (ENABLE_ASAN)
        message(STATUS "build with ASAN")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
endif ()

find_package(ffmpeg)
find_package(libjpeg-turbo)
find_package(opengl-registry)


target_link_libraries(CrossPlatformPlayer
        SDL2::SDL2main
        ffmpeg::ffmpeg
        glog::glog
        libjpeg-turbo::libjpeg-turbo

        opengl-registry::opengl-registry
#        SDL2_image::SDL2_image
        )
#if (WIN32)
#    target_link_libraries(
#            CrossPlatformPlayer PRIVATE SDL2main
#    )
#endif()
